package com.pospi.xstore.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.lany.sp.SPHelper;
import com.pospi.xstore.R;
import com.pospi.xstore.dto.CashierMsgDto;
import com.pospi.xstore.ui.PrintSettingActivity;
import com.pospi.xstore.util.Constant;
import com.pospi.xstore.util.PareseJson;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainLeftDrawerFragment extends Fragment {

    @Bind(R.id.store_name)
    TextView storeName;
    @Bind(R.id.cashier_name)
    TextView cashierName;
    //    @Bind(R.id.printer)
//    TextView printer;
//    @Bind(R.id.ll_print)
//    LinearLayout llPrint;

    private Context context;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_main_left_drawer, container, false);
        ButterKnife.bind(this, view);
        context = getActivity();

        String storename = SPHelper.getInstance().getString(Constant.STORE_NAME);
//        String value = context.getSharedPreferences("Token", Context.MODE_PRIVATE).getString("value", "");
//        String[] names = value.split("\\,");
//        String deviceNo = names[2];//得到token的值
//        int which = context.getSharedPreferences("islogin", Context.MODE_PRIVATE).getInt("which", 0);
//        List<CashierMsgDto> cashierMsgDtos = new PareseJson().parese(context.getSharedPreferences("cashierMsgDtos", Context.MODE_PRIVATE).getString("cashierMsgDtos", ""));
        String name = "";
        String id = "";
        storeName.setText(storename);
        cashierName.setText("默认");

//        byte status = PrnTest.prnStatus();
//        showStatus(status);
        return view;
    }

//

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

//    @OnClick(R.id.ll_print)
//    public void onClick() {
////        Intent intent = new Intent(getActivity(), PrintSettingActivity.class);
////        startActivity(intent);
//    }
}
